package factorial;

import java.util.Scanner;
import songuyenlon.SoNguyenLon;

public class Factorial {
	
	/*
	 * Ham main() tinh gia thua cua so nguyen lon.
	 */
	
	public static void main(String[] argv){
		Scanner s = new Scanner(System.in);
        System.out.print("Tinh giai thua cua: ");
        long m = s.nextLong();
        SoNguyenLon A1 = new SoNguyenLon("1");
        long start, stop;
        start = System.currentTimeMillis();
        for(int i=1;i<m+1;i++) {
        	A1 = A1.Nhan(new SoNguyenLon(i));
        }
        System.out.print(+m+"! = ");
        A1.In();
        stop =  System.currentTimeMillis();
        System.out.println("Thoi gian chay "+m+"! = "+(stop-start)+"(ms)");
    }
}
